package com.hliushi.learn.jms;

import com.hliushi.learn.config.ActiveMqConfig;
import org.springframework.jms.annotation.JmsListener;

/**
 * @ClassName TopicConsumer
 * @Description Topic消息消费者
 * @Author liushi
 * @Date 2021/7/9 9:38
 * @Version V1.0
 **/
// @Service
public class TopicConsumer {

    /**
     * 接收订阅消息
     *
     * @param msg
     */
    @JmsListener(destination = ActiveMqConfig.TOPIC_NAME, containerFactory = "topicListenerContainer")
    public void receiveTopicMsg(String msg) {
        System.out.println("消费者1 -- 收到的消息为: " + msg);
    }
}
